<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    function Parent(username, age) {
      this.username = username
      this.age = age
    }
    Parent.prototype.say = function () {
      console.log('用户信息：', `用户名：${this.username},年龄：${this.age}`)
    }
    let p1 = new Parent('zhangsan', 18)
    p1.say()
    let p2 = new Parent('lisi', 20)
    p2.say()

    console.log('========class=======')
    class Parent1 {
      constructor(username, age) {
        this.username = username
        this.age = age
      }
      say() {
        console.log('=====class用户信息：', `用户名：${this.username},年龄：${this.age}`)

      }

    }
    let p11 = new Parent('zhangsan', 18)
    p11.say()
    let p22 = new Parent('lisi', 20)
    p22.say()
    
    class Child1 extends Parent1 {
      //  email = '1234@163.com'
       constructor (username, age, email) {
        super(username, age)
         this.email = email
       }
      static isType = 'admin'
       
      say () {
      
        console.log('=====class用户信息：', this,`用户名：${this.username},年龄：${this.age},邮箱：${this.email}`)
      
      }
    }
    
    console.log('-----------------child1-------')
    let c1 = new Child1('wangwu', 30, 'test@qq.com')
    console.log('c1', c1,c1.isType, Child1.isType)
    c1.say()
   
    
    
    


  </script>
</body>

</html>